import request from '@/utils/request'
import { ref } from 'vue'
export default () => {
	const dish = ref({})
	const carousel_images = ref([])
	const getDish = async (id) => {
		let { data } = await request.get(`mini/dish/${id}`)
		dish.value = data
		carousel_images.value = data.carousel_images.map(item => {
			return {
				img: item,
				title: "",
				url: item,
				link: item,
				opentype: 'click'
			}
		})
		console.log(carousel_images.value)
	}

	return {
		dish,
		getDish,
		carousel_images
	}
}